#include "../system.h"

int main(){
    
    char Paramstr[100];
    nodeAddress A,B,C,D,E,F;
    edgeAddress EA;
    TabelMhs TMhs1, TMhs2, TMhs3, TMhs4;
    TabelMK TMK1;
    ownerList O;
    ownerAddress OA,OB,OC,OD,OE,OF;
    NODELIST=CreateEmptyNodeList();
    EDGELIST=CreateEmptyEdgeList();
    TABELMHS=CreateEmptyTabelMhs();
    TABELMK=CreateEmptyTabelMK();
    
    A=AllocateNode(CharToString("A"),0.0025, 0.0025, 0.0025, 0.0025, true, true);
    B=AllocateNode(CharToString("B"),0.002, 0.002, 0.002, 0.002, true, true);
    C=AllocateNode(CharToString("C"),0.003, 0.003, 0.003, 0.003, false, true);
    D=AllocateNode(CharToString("D"),0.001, 0.001, 0.001, 0.001, true, true);
    E=AllocateNode(CharToString("E"),9999, 9999, 9999, 9999, true, false);
    F=AllocateNode(CharToString("F"),0.001, 0.001, 0.001, 0.001, true, true);
    
    AddNode(&NODELIST,A);
    AddNode(&NODELIST,B);
    AddNode(&NODELIST,C);
    AddNode(&NODELIST,D);
    AddNode(&NODELIST,E);
    
    EA=AllocateEdge(A,B,2.5,2.5);
    AddEdge(&EDGELIST,EA);
    
    EA=AllocateEdge(A,C,1,1);
    AddEdge(&EDGELIST,EA);
    
    EA=AllocateEdge(B,C,2,2);
    AddEdge(&EDGELIST,EA);
    
    EA=AllocateEdge(B,E,2.5,2.5);
    AddEdge(&EDGELIST,EA);
    
    EA=AllocateEdge(C,D,0.5,0.5);
    AddEdge(&EDGELIST,EA);
    
    EA=AllocateEdge(C,E,3,3);
    AddEdge(&EDGELIST,EA);
    
    OA=AllocateOwnerList(A);
    OB=AllocateOwnerList(B);
    OC=AllocateOwnerList(C);
    OD=AllocateOwnerList(D);
    OE=AllocateOwnerList(E);
    OF=AllocateOwnerList(F);
    
    TMhs1=AllocateRecordMhs(CharToString("13508004"), CharToString("Test1"), MakeTanggal(12,04,1990), CharToString("Jakarta"));
    TMhs1->_ownerList=CreateEmptyOwnerList();
    
    AddOwner(&(TMhs1->_ownerList),OA);
    AddOwner(&(TMhs1->_ownerList),OB);
    
    TMhs2=AllocateRecordMhs(CharToString("14509252"), CharToString("Test2"), MakeTanggal(12,04,1990), CharToString("Jakarta"));
    TMhs2->_ownerList=CreateEmptyOwnerList();
    AddOwner(&(TMhs2->_ownerList),OC);
    AddOwner(&(TMhs2->_ownerList),OD);
    
    TMhs3=AllocateRecordMhs(CharToString("15409252"), CharToString("Test3"), MakeTanggal(12,04,1990), CharToString("Jakarta"));
    TMhs3->_ownerList=CreateEmptyOwnerList();
    AddOwner(&(TMhs3->_ownerList),OA);
    
    TMhs4=AllocateRecordMhs(CharToString("18509252"), CharToString("Test4"), MakeTanggal(12,04,1990), CharToString("Jakarta"));
    TMhs4->_ownerList=CreateEmptyOwnerList();
    AddOwner(&(TMhs4->_ownerList),OC);
    
    TMK1=AllocateRecordMK(CharToString("EL123"), CharToString("Test4"),5,CharToString("Jakarta"));
    TMK1->_ownerList=CreateEmptyOwnerList();
    AddOwner(&(TMK1->_ownerList),OB);
    
    FIRST(TABELMHS)=TMhs1;
    NEXT(TMhs1)=TMhs2;
    NEXT(TMhs2)=TMhs3;
    NEXT(TMhs3)=TMhs4;
    NEXT(TMhs4)=NULL;
    
    FIRST(TABELMK)=TMK1;
    NEXT(TMK1)=NULL;
    
    HAS_TMHS(A)=1;
    HAS_TMHS(B)=1;
    HAS_TMK(B)=1;
    HAS_TMHS(C)=1;
    HAS_TMHS(D)=1;
    
    InitCGraphics(SIMULASI);

    ParseListCommand("clients serVeRs asdas  gdfstables connections");
    // silahkan ganti parameternya, nggak case sensitive, nggak peduli urutan parameter
    // dan parameter yg nggak dikenali akan diabaikan
    // parameter yang ada : sites servers clients connections tables asc desc
    // klo parameter sites dimasukkan, otomatis servers clients dan tables juga akan diprint, sisanya connections
    // nggak diprint, kecuali kalau di parameter sudah dimasukkan connections
    
    
    StartPrintMsg();

}
